﻿Public Class RegexNumberedGroupViewModel
    Inherits RegexViewModelBase
    Implements IEnumerable(Of RegexCapturesViewModel)

#Region "Events"
    ' Insert Event Declarations Here
#End Region

#Region "Properties"
#Region "Constants"
    ' Insert Constant Declarations Here
#End Region

    Private _group As Group
    Public Property Group() As Group
        Get
            Return _group
        End Get
        Private Set(ByVal value As Group)
            _group = value
        End Set
    End Property

    Private _number As Integer
    Public Property Number() As Integer
        Get
            Return _number
        End Get
        Private Set(ByVal value As Integer)
            _number = value
        End Set
    End Property

    Public Overrides ReadOnly Property Index As Integer
        Get
            Return Me.Group.Index
        End Get
    End Property

    Public Overrides ReadOnly Property Length As Integer
        Get
            Return Me.Group.Length
        End Get
    End Property

#End Region

#Region "Constructors"
    Public Sub New(number As Integer, group As Group, regex As Regex, viewNavigator As IViewNavigator)
        MyBase.New(regex, viewNavigator)
        Me.Number = number
        Me.Group = group
    End Sub
#End Region

#Region "Methods"
    Public Function GetEnumerator() As System.Collections.Generic.IEnumerator(Of RegexCapturesViewModel) Implements System.Collections.Generic.IEnumerable(Of RegexCapturesViewModel).GetEnumerator
        Return New RegexCapturesViewModel() {New RegexCapturesViewModel(Me.Group.Captures, Me.Regex, MyBase.ViewNavigator)}.AsEnumerable().GetEnumerator()
    End Function

    Private Function GetEnumerator1() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
        Return GetEnumerator()
    End Function

#Region "Event Raiser Methods"
    ' Insert Method Declarations which Raise an Event Here
#End Region

#Region "Event Handlers"
    ' Insert Method Declarations which Handle an Event Here
#End Region
#End Region

End Class
